package com.tyk.bookstore.back.platform.model.vo;


import com.tyk.bookstore.back.common.core.model.page.PageVo;
import com.tyk.bookstore.back.common.core.util.FileUtil;
import com.tyk.bookstore.back.platform.model.enume.CarouselState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 轮播图
 */
@Data
public class CarouselPageVo extends PageVo<CarouselPageVo.Carousel> {

    @Data
    public static class Carousel {

        @Schema(description = "ID")
        private Long id;

        @Schema(description = "路径")
        private String path;

        @Schema(description = "关联链接")
        private String link;

        @Schema(description = "优先级")
        private Integer priority;

        @Schema(description = "描述")
        private String description;

        @Schema(description = "状态")
        private CarouselState state;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        public Carousel setPath(String path) {
            this.path = FileUtil.fullFilePath(path);
            return this;
        }
    }
}
